#include<bits/stdc++.h>
using namespace std;
namespace my_std{
#define mems(x,y) memset(x,y,sizeof x)
#define Mp make_pair
#define eb emplace_back
#define gc getchar
#define pc putchar
#define fi first
#define se second
#define il inline
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define drep(i,a,b) for(int i=(a);i>=(b);i--)
#define go(i,u) for(int i=head[u];i;i=e[i].nxt)
	typedef long long ll;
	typedef pair<int,int> pii;
	il int read(){
		int x=0,f=1;char c=gc();
		while(c<'0'||c>'9'){if(c=='-')f=-1;c=gc();}
		while(c>='0'&&c<='9')x=x*10+c-48,c=gc();
		return x*f;
	}
	il void write(int x){
		char buf[23];int len=0;
		if(x<0)pc('-'),x=-x;
		do buf[++len]=x%10,x/=10;while(x);
		while(len)pc(buf[len--]+'0');
	}
}
using namespace my_std;
const int N=1e6+7,M=-1,inf=0x3f3f3f3f,mod=0;
#define double long double
int n,m,a[N],b[N],c[N];
double h[N],l[N];
void Yorushika(){
	scanf("%d",&n);
	double ans=0;
	rep(i,1,n){
		scanf("%d%d%d",&c[i],&a[i],&b[i]);
		a[i]*=2,b[i]*=2;
		l[i]=1.0*c[i]*a[i]/(b[i]-a[i]);
		//printf("%Lf\n",l[i]);
		double k=1.0*c[i]/(b[i]-a[i])*2;
		rep(j,1,i-1){
			if(a[i]>=b[j]){
				h[i]=max(h[i],h[j]+c[j]);
			}else{
				h[i]=max(h[i],1.0*a[i]/b[j]*(l[j]+c[j])-l[j]+h[j]);
				if(b[i]>=b[j]){
					h[i]=max(h[i],c[j]-0.5*b[j]*k+l[i]+h[j]);
				}
			}
			if(b[i]<=b[j]){
				h[i]=max(h[i],1.0*b[i]/b[j]*(l[j]+c[j])-l[j]+h[j]-c[i]);
			}
			h[i]=max(h[i],h[j]);
		};cout<<h[i]<<" ";
		//printf("%Lf\n",h[i]);
		ans=max(ans,h[i]+c[i]);
	};
	printf("%.12Lf\n",ans);
}
signed main(){
	freopen("wan.in","r",stdin);
	freopen("wan.out","w",stdout);
	Yorushika();
}